<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.Chart.UI.EnumResources"
    xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals">
    <DataTemplate DataType="{x:Type System:Enum}">
        <TextBlock Text="{Binding Converter={x:Static Internals:ChartConverters.EnumToNameConverter}}"/>
    </DataTemplate>
    <Style TargetType="{x:Type ListBox}" x:Key="EnumListBoxStyle">
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}" >
                                    <RadioButton IsChecked="{TemplateBinding IsSelected}"
                                                         Content="{TemplateBinding Content, Converter={x:Static Internals:ChartConverters.EnumToNameConverter}}"
                                                         />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <EventSetter Event="PreviewMouseDown" Handler="ListBoxItemPreviewMouseDown"/>

                    </Style>

            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type ComboBox}" x:Key="EnumComboBoxStyle">
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ComboBoxItem}" >
                                <TextBlock Text="{TemplateBinding Content, Converter={x:Static Internals:ChartConverters.EnumToNameConverter}}"
                                                         />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <EventSetter Event="PreviewMouseDown" Handler="ComboBoxItemPreviewMouseDown"/>

                </Style>

            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>